import request from '../http/request';

export function getCourses() {
  return request({
    url: '/course/list',
    method: 'get'
  });
}

export const deleteCourseById = (id) => {
  return request({
      url: `/course/${id}`, // 根据你的实际路径修改
      method: 'delete',
  });
};

export function saveOrUpdateCourse(data) {
  return request({
    url: data.id ? '/course/update' : '/course/add',
    method: data.id ? 'put' : 'post',
    data
  });
}

